<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>时钟特效</title>
</head>
<body>
    <h1 id="myclock"></h1>
    <script>
        function disptime(){
            const now = new Date();
            const hh = now.getHours();
            const mm = now.getMinutes();
            const ss = now.getSeconds();
            document.getElementById("myclock").innerText
                = "现在时间是:" + hh +" : " + mm + " : " + ss;
        }

        setInterval(function (){
            disptime()
        },1000)

    </script>
</body>
</html>